/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface BasWarehouse extends BasicModel<BasWarehouse> {
  whcode?: string; // 仓库编码
  whname?: string; // 仓库名称
}

export const basWarehouseList = (params?: BasWarehouse | any) =>
  defHttp.get<BasWarehouse>({ url: adminPath + '/bas/house/basWarehouse/list', params });

export const basWarehouseListData = (params?: BasWarehouse | any) =>
  defHttp.post<Page<BasWarehouse>>({ url: adminPath + '/bas/house/basWarehouse/listData', params });

export const basWarehouseForm = (params?: BasWarehouse | any) =>
  defHttp.get<BasWarehouse>({ url: adminPath + '/bas/house/basWarehouse/form', params });

export const basWarehouseSave = (params?: any, data?: BasWarehouse | any) =>
  defHttp.postJson<BasWarehouse>({ url: adminPath + '/bas/house/basWarehouse/save', params, data });

export const basWarehouseDelete = (params?: BasWarehouse | any) =>
  defHttp.get<BasWarehouse>({ url: adminPath + '/bas/house/basWarehouse/delete', params });

export const basWarehousetreeData = (params?: BasWarehouse | any) =>
  defHttp.post<BasWarehouse>({ url: adminPath + '/bas/house/basWarehouse/treeData', params });
